<template>
  <div class="home">

			<top title="订单详情"></top>



			<div class="navBg" v-if="systemStr == 'Y' " >
					<h3> 	<img src="@/../static/img/shenqing.png" alt="" />收货上架</h3>
					<div class="navItems">
							<div class="navBar" v-for="(item, index) in shouhuoY" :key="index" @click="toPage(item.path)" >
									<img :src="item.imgUrl" alt="" />
									<span>{{ item.name }}</span>
							</div>
					</div>
			</div>


			<div class="navBg" v-if="systemStr == 'N' " >
					<h3> 	<img src="@/../static/img/shenqing.png" alt="" />收货上架</h3>
					<div class="navItems">
							<div class="navBar" v-for="(item, index) in shouhuoN" :key="index" @click="toPage(item.path)" >
									<img :src="item.imgUrl" alt="" />
									<span>{{ item.name }}</span>
							</div>
					</div>
			</div>




  </div>
</template>

<script>
import top from '@/components/header.vue'//引入封装的组件
import { mapActions } from 'vuex';
import { logout } from '@/utils/auth';

export default {
  name: 'mainPage',
  components: {
		top
  },
  data() {
    return {
			urlBg: require("@/../static/img/bgcolor.png"),
			imgs: [{ imgUrl: require('@/../static/img/banner.png') }],
			shouhuoY:[
				{ name: '收货启动', imgUrl: require('@/../static/img/newcj_beifen.png'), path: '/shouhuoqidongnews' },
				{ name: '收货上架', imgUrl: require('@/../static/img/fc3.png'), path: '/ywshouhuo_shsj' },
				{ name: '验货收货', imgUrl: require('@/../static/img/newgoods.png'), path: '/ywshouhuo_yhsh' },
				{ name: '收货修正', imgUrl: require('@/../static/img/fc4.png'), path: '/ywshouhuo_shxg' },
        { name: '取消收货', imgUrl: require('@/../static/img/fc4.png'), path: '/quxiaoshouhuo' },
				{ name: '任务概况', imgUrl: require('@/../static/img/newgoods.png'), path: '/renwugaikuang' },
				{ name: '退出', imgUrl: require('@/../static/img/tcdl.png'), path: '/login' },
			],
			shouhuoN:[
				{ name: '收货启动', imgUrl: require('@/../static/img/newcj_beifen.png'), path: '/shouhuoqidongnews' },
				{ name: '收货上架', imgUrl: require('@/../static/img/fc3.png'), path: '/ywshouhuo_shsj' },
				{ name: '验货收货', imgUrl: require('@/../static/img/newgoods.png'), path: '/ywshouhuo_yhsh' },
				{ name: '收货修正', imgUrl: require('@/../static/img/fc4.png'), path: '/ywshouhuo_shxg' },
				{ name: '托盘混载', imgUrl: require('@/../static/img/fc1.png'), path: '/tuopanhunzai' },
				{ name: '混载解绑', imgUrl: require('@/../static/img/fc2.png'), path: '/hunzaijiebang' },
				{ name: '收货结单', imgUrl: require('@/../static/img/fc3.png'), path: '/shouhuojiedan' },
				{ name: '取消收货', imgUrl: require('@/../static/img/fc4.png'), path: '/quxiaoshouhuo' },
				{ name: '直通分货', imgUrl: require('@/../static/img/newcj_beifen.png'), path: '/zhitongfenhuo' },
				{ name: '采购退货', imgUrl: require('@/../static/img/sqcx.png'), path: '/caigoutuihuo' },
				{ name: '收货查询', imgUrl: require('@/../static/img/news.png'), path: '/shouhuochaxun' },
				{ name: '任务概况', imgUrl: require('@/../static/img/fc4.png'), path: '/renwugaikuang' },
				{ name: '退出', imgUrl: require('@/../static/img/tcdl.png'), path: '/login' },
			],
			systemStr:'',
		};
  },
  methods: {
    ...mapActions(['clearCache']),
    async toPage(path) {
      if (path === '/login') {
        await logout();
      } else {
        this.$router.push({ path: path });
      }
    },
		selectActive(index){
			this.active = index
			// localStorage.setItem('index',this.active);
			// alert(this.active)
		},
    async handleLogout() {
      await logout();
    }
  },
  mounted() {
    //console.log("-- 可能需要处理功能权限 --");
    var _self = this; var l_hy = this.GWO(true).gUSER;  window.GWO().debug=this;
		console.log("登录返回")
		console.log(window._gwo_.gUSER)
		var lt_ms = new Date(window._gwo_.gUSER.timestamp).getTime() - new Date().getTime();
		if(lt_ms > 60000 || lt_ms < -60000){
			// alert("当前时间存在误差请手动修改本地时间")
		}
		this.systemStr = window.sessionStorage.getItem("system");
		console.log(this.systemStr)
  },
};
</script>

<style lang="scss" scoped>

div.navBg{
	width:94%;
	margin-left:3%;
	margin-right:3%;
	background-color: #fff;
	// border-bottom-right-radius: 10px;
	// border-bottom-left-radius:10px;
	border-radius: 10px;
	margin-bottom: 20px;
	margin-top: 10px;
	h3{
		display: flex;
		align-items: center;
		padding: 13px 0 10px 10px;
		font-size: 18px;
		font-weight: bold;
		color: #505558;
		img{
			width:25px;
			height: 25px;
			margin-right:10px;
		}
	}
	div.navItems{
		display: flex;
		flex-wrap: wrap;
		box-sizing: border-box;
		padding-left: 10px;
		padding-right: 10px;
		padding-top: 10px;
		div.navBar{
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			width: 25%;
			margin-bottom: 20px;
			img{
				width: 50px;
				height: 50px;
				margin-bottom: 20px;
			}
			span{
				font-size:13px;
			}
		}
	}
}

div.home{
	background: #F5F8FA;
	width: 100%;
	height: 100%;
	box-sizing:border-box;
	// padding-bottom: 100px;
	overflow: auto;
}


.navFooter{
	height:65px;
}
</style>
